package com.betterjr.modules.application.dubbo;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.dubbo.config.annotation.Service;
import com.betterjr.common.web.AjaxObject;
import com.betterjr.modules.application.IApplicationOperatorService;
import com.betterjr.modules.application.service.ApplicationOperatorService;

/**
 * 
 * @ClassName: ApplicationOperatorDubboService 
 * @Description: 应用定制dubbo服务 
 * @author xuyp
 * @date 2017年11月30日 下午2:13:23 
 *
 */
@Service(interfaceClass = IApplicationOperatorService.class)
public class ApplicationOperatorDubboService implements IApplicationOperatorService {

    @Autowired
    private ApplicationOperatorService applicationOperatorService;

    /**
     * 查询当前操作员定制的服务
     * <p>Overriding Method of webQueryApplicationsCurrentUser</p>  
     * <p>Description: </p> 
     * @param anBusinStatus
     * @param anOperatorId
     * @param anBuilder
     * @return 
     * @see com.betterjr.modules.application.IApplicationOperatorService#webQueryApplicationsCurrentUser(java.lang.String, java.lang.Long, java.util.Map) 
     * @author xuyp
     * @date 2017年11月30日 下午2:13:45
     */
    @Override
    public String webQueryApplicationsCurrentUser(String anBusinStatus, Long anOperatorId,
            Map<String, Object> anBuilder) {

        return AjaxObject
                .newOk("操作成功",
                        applicationOperatorService.queryApplicationsCurrentUser(anBusinStatus, anOperatorId, anBuilder))
                .toJson();
    }

    /**
     * 新增或者修改应用的定制
     * <p>Overriding Method of webSaveAddOrUpdateApplicationOperator</p>  
     * <p>Description: </p> 
     * @param anMap
     * @return 
     * @see com.betterjr.modules.application.IApplicationOperatorService#webSaveAddOrUpdateApplicationOperator(java.util.Map) 
     * @author xuyp
     * @date 2017年11月30日 下午2:14:06
     * 
     * applicationId
     * filterfalg    是否拦截  1 默认不拦截   2 拦截
     * proprity   是否是个性定制应用   1 是   2 不是
     * proprityLevel  个性定制显示的优先级 越小越优先
     */
    @Override
    public String webSaveAddOrUpdateApplicationOperator(Map<String, Object> anMap) {

        return AjaxObject.newOk("操作成功", applicationOperatorService.saveAddOrUpdateApplicationOperator(anMap)).toJson();
    }

}
